﻿
Public Class envioDAL
    Dim db As dataBaseDataContext
    Sub New()
        Try
            db = New dataBaseDataContext(sqlConfiguracion.GetConnectionString)
        Catch ex As Exception
        End Try
    End Sub

    Sub nuevoEnvio(obraDestino As Obra, herramienta As HerramientasEnStock, cantidadEnviada As Integer, FechaEnvio As Date, obs As String)
        Try
            Dim H As New HerramientasEnStockDal
            Dim env As New Envio()
            env.Cantidad = cantidadEnviada
            env.FechaPrestado = FechaEnvio
            env.HerramientasEnStock = herramienta
            env.Obra = obraDestino
            env.Observaciones = obs
            If H.Enviar(env) Then
                db.Envio.InsertOnSubmit(env)
                db.SubmitChanges()
            End If
        Catch ex As Exception

        End Try
    End Sub
End Class
